//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __oaidl_h__
#define __oaidl_h__

#ifdef __cplusplus
extern "C"{
#endif

/* Forward Declarations */

#ifndef __IDispatch_FWD_DEFINED__
#define __IDispatch_FWD_DEFINED__
typedef interface IDispatch IDispatch;
#endif     /* __IDispatch_FWD_DEFINED__ */

#ifndef __IEnumVARIANT_FWD_DEFINED__
#define __IEnumVARIANT_FWD_DEFINED__
typedef interface IEnumVARIANT IEnumVARIANT;
#endif     /* __IEnumVARIANT_FWD_DEFINED__ */

#ifndef __ITypeComp_FWD_DEFINED__
#define __ITypeComp_FWD_DEFINED__
typedef interface ITypeComp ITypeComp;
#endif     /* __ITypeComp_FWD_DEFINED__ */

#ifndef __ITypeLib_FWD_DEFINED__
#define __ITypeLib_FWD_DEFINED__
typedef interface ITypeLib ITypeLib;
#endif     /* __ITypeLib_FWD_DEFINED__ */

#ifndef __ITypeInfo_FWD_DEFINED__
#define __ITypeInfo_FWD_DEFINED__
typedef interface ITypeInfo ITypeInfo;
#endif     /* __ITypeInfo_FWD_DEFINED__ */

/* header files for imported files */
#include "objidl.h"

/* interface __MIDL_itf_oaidl_0000 */
/* [local] */

enum VARENUM
{
    VT_EMPTY = 0,
    VT_NULL = 1,
    VT_I2 = 2,
    VT_I4 = 3,
    VT_R4 = 4,
    VT_R8 = 5,
    VT_CY = 6,
    VT_DATE = 7,
    VT_BSTR = 8,
    VT_DISPATCH = 9,
    VT_ERROR = 10,
    VT_BOOL = 11,
    VT_VARIANT = 12,
    VT_UNKNOWN = 13,
    VT_OBJECT = VT_UNKNOWN,
    VT_DECIMAL = 14,
    VT_I1 = 16,
    VT_UI1 = 17,
    VT_UI2 = 18,
    VT_UI4 = 19,
    VT_I8 = 20,
    VT_UI8 = 21,
    VT_INT = 22,
    VT_UINT = 23,
    VT_VOID = 24,
    VT_ECODE = 25,
    VT_PTR = 26,
    VT_SAFEARRAY = 27,
    VT_CARRAY = 28,
    VT_USERDEFINED = 29,
    VT_LPSTR = 30,
    VT_LPWSTR = 31,
    VT_RECORD = 36,
    VT_FILETIME = 64,
    VT_BLOB = 65,
    VT_STREAM = 66,
    VT_STORAGE = 67,
    VT_STREAMED_OBJECT = 68,
    VT_STORED_OBJECT = 69,
    VT_BLOB_OBJECT = 70,
    VT_CF = 71,
    VT_CLSID = 72,
    VT_VERSIONED_STREAM = 73,
    VT_EzByteBuf = 74,
    VT_EzStrBuf = 75,
    VT_EzWCharBuf       = 76,
    VT_BSTR_BLOB = 0xfff,
    VT_VECTOR = 0x1000,
    VT_ARRAY = 0x2000,
    VT_BYREF = 0x4000,
    VT_RESERVED = 0x8000,
    VT_ILLEGAL = 0xffff,
    VT_ILLEGALMASKED = 0xfff,
    VT_TYPEMASK = 0xfff
};
typedef struct  tagSAFEARRAYBOUND
    {
    UInt32 cElements;
    Int32 lLbound;
    }    SAFEARRAYBOUND;

typedef struct tagSAFEARRAYBOUND *PSAFEARRAYBOUND;

typedef struct tagSAFEARRAY {
    UInt16 cDims;
    UInt16 fFeatures;
    UInt32  cbElements;
    UInt32  cLocks;
    PVoid  pvData;
    SAFEARRAYBOUND rgsabound[1];
} SAFEARRAY, * LPSAFEARRAY;
#define    FADF_AUTO ( 0x1 )

#define    FADF_STATIC ( 0x2 )

#define    FADF_EMBEDDED ( 0x4 )

#define    FADF_FIXEDSIZE ( 0x10 )

#define    FADF_RECORD ( 0x20 )

#define    FADF_HAVEIID ( 0x40 )

#define    FADF_HAVEVARTYPE ( 0x80 )

#define    FADF_BSTR ( 0x100 )

#define    FADF_UNKNOWN ( 0x200 )

#define    FADF_DISPATCH ( 0x400 )

#define    FADF_VARIANT ( 0x800 )

#define    FADF_DESOWNER ( 0x4000 )

#define    FADF_RESERVED ( 0x3008 )

typedef double DATE;

typedef union tagCY {
    struct {
        unsigned long Lo;
        long      Hi;
    };
    Int64 int64;
} CY;
typedef CY *PCY;

typedef struct tagDEC {
    UInt16 wReserved;
    union {
        struct {
            Byte scale;
            Byte sign;
        };
        UInt16 signscale;
    };
    UInt32 Hi32;
    union {
        struct {
            UInt32 Lo32;
            UInt32 Mid32;
        };
        UInt64 Lo64;
    };
} DECIMAL;
#define DECIMAL_NEG ((Byte)0x80)
#define DECIMAL_SETZERO(dec) \
        {(dec).Lo64 = 0; (dec).Hi32 = 0; (dec).signscale = 0;}
typedef DECIMAL *PDECIMAL;

/* 0 == FALSE, -1 == TRUE */
typedef short VARIANT_BOOL;

#if !__STDC__ && (_MSC_VER <= 1000)
/* For backward compatibility */
typedef VARIANT_BOOL _VARIANT_BOOL;

#else
/* ANSI C/C++ reserve bool as keyword */
#define _VARIANT_BOOL    /##/
#endif
typedef struct tagVARIANT VARIANT;

typedef unsigned short VARTYPE;

struct  tagVARIANT
{
    union
    {
        struct  __tagVARIANT
        {
            VARTYPE vt;
            UInt16 wReserved1;
            UInt16 wReserved2;
            UInt16 wReserved3;
            union
            {
                Int32 lVal;
                Byte bVal;
                Int16 iVal;
                Float fltVal;
                Double dblVal;
                VARIANT_BOOL boolVal;
                ECode scode;
                CY cyVal;
                DATE date;
                wchar_t* bstrVal;
                IUnknown *punkVal;
                IDispatch *pdispVal;
                IInterface *pObjVal;
                SAFEARRAY *parray;
                Byte *pbVal;
                Int16 *piVal;
                Int32 *plVal;
                Float *pfltVal;
                Double *pdblVal;
                VARIANT_BOOL *pboolVal;
                ECode *pscode;
                CY *pcyVal;
                DATE *pdate;
                wchar_t* *pbstrVal;
                IUnknown **ppunkVal;
                IInterface **ppObjVal;
                IDispatch **ppdispVal;
                SAFEARRAY **pparray;
                VARIANT *pvarVal;
                PVoid byref;
                char cVal;
                UInt16 uiVal;
                UInt32 ulVal;
                Int32 intVal;
                UInt32 uintVal;
                DECIMAL *pdecVal;
                char *pcVal;
                UInt16 *puiVal;
                UInt32 *pulVal;
                Int32 *pintVal;
                UInt32 *puintVal;
            } __VARNAME_3;
        } __VARNAME_2;
        DECIMAL decVal;
    } __VARNAME_1;
};
typedef VARIANT *PVARIANT;

typedef VARIANT VARIANTARG;

typedef VARIANT *PVARIANTARG;

#define V_UNION(X, Y) ((X).__VARNAME_1.__VARNAME_2.__VARNAME_3.Y)
#define V_VT(X) ((X).__VARNAME_1.__VARNAME_2.vt)
typedef UInt32 HREFTYPE;

typedef Int32 DISPID;

typedef DISPID MEMBERID;

typedef struct  tagDISPPARAMS
    {
    /* [size_is] */ VARIANTARG *rgvarg;
    /* [size_is] */ DISPID *rgdispidNamedArgs;
    UInt32 cArgs;
    UInt32 cNamedArgs;
    }    DISPPARAMS;

typedef /* [v1_enum] */
enum tagTYPEKIND
    {    TKIND_ENUM = 0,
    TKIND_RECORD = TKIND_ENUM + 1,
    TKIND_MODULE = TKIND_RECORD + 1,
    TKIND_INTERFACE = TKIND_MODULE + 1,
    TKIND_DISPATCH = TKIND_INTERFACE + 1,
    TKIND_COCLASS = TKIND_DISPATCH + 1,
    TKIND_ALIAS = TKIND_COCLASS + 1,
    TKIND_UNION = TKIND_ALIAS + 1,
    TKIND_MAX = TKIND_UNION + 1
    }    TYPEKIND;

typedef struct  tagTYPEDESC
    {
    /* [switch_is][switch_type] */ union
        {
        /* [case()] */ struct tagTYPEDESC *lptdesc;
        /* [case()] */ struct tagARRAYDESC *lpadesc;
        /* [case()] */ HREFTYPE hreftype;
        /* [default] */  /* Empty union arm */
        }    ;
    VARTYPE vt;
    }    TYPEDESC;

typedef struct tagARRAYDESC {
    TYPEDESC tdescElem;              /* element type */
    UInt16 cDims;                    /* dimension count */
    SAFEARRAYBOUND rgbounds[1];      /* var len array of bounds */
} ARRAYDESC, * PARRAYDESC;
typedef struct  tagPARAMDESCEX
    {
    UInt32 cBytes;
    VARIANTARG varDefaultValue;
    }    PARAMDESCEX;

typedef struct tagPARAMDESCEX *PPARAMDESCEX;

typedef struct  tagPARAMDESC
    {
    PPARAMDESCEX pparamdescex;
    UInt16 wParamFlags;
    }    PARAMDESC;

typedef struct tagPARAMDESC *PPARAMDESC;

typedef struct  tagIDLDESC
    {
    UInt32 dwReserved;
    UInt16 wIDLFlags;
    }    IDLDESC;

typedef struct tagIDLDESC *PIDLDESC;

typedef struct tagELEMDESC {
    TYPEDESC tdesc;          /* the type of the element */
    union {
        IDLDESC idldesc;     /* info for remoting the element */
        PARAMDESC paramdesc; /* info about the parameter */
    };
} ELEMDESC, * PELEMDESC;
typedef struct  tagTYPEATTR
    {
    GUID guid;
    UInt32 lcid;
    UInt32 dwReserved;
    MEMBERID memidConstructor;
    MEMBERID memidDestructor;
    wchar_t * lpstrSchema;
    UInt32 cbSizeInstance;
    TYPEKIND typekind;
    UInt16 cFuncs;
    UInt16 cVars;
    UInt16 cImplTypes;
    UInt16 cbSizeVft;
    UInt16 cbAlignment;
    UInt16 wTypeFlags;
    UInt16 wMajorVerNum;
    UInt16 wMinorVerNum;
    TYPEDESC tdescAlias;
    IDLDESC idldescType;
    }    TYPEATTR;

typedef struct tagTYPEATTR *PTYPEATTR;

typedef struct tagEXCEPINFO {
    UInt16  wCode;
    UInt16  wReserved;
    wchar_t*  bstrSource;
    wchar_t*  bstrDescription;
    wchar_t*  bstrHelpFile;
    UInt32 dwHelpContext;
    PVoid pvReserved;
    ECode (__stdcall *pfnDeferredFillIn)(struct tagEXCEPINFO *);
    ECode scode;
} EXCEPINFO, * PEXCEPINFO;
typedef /* [v1_enum] */
enum tagCALLCONV
    {    CC_CDECL = 1,
    CC_MSCPASCAL = CC_CDECL + 1,
    CC_PASCAL = CC_MSCPASCAL,
    CC_MACPASCAL = CC_PASCAL + 1,
    CC_STDCALL = CC_MACPASCAL + 1,
    CC_RESERVED = CC_STDCALL + 1,
    CC_SYSCALL = CC_RESERVED + 1,
    CC_MPWCDECL = CC_SYSCALL + 1,
    CC_MPWPASCAL = CC_MPWCDECL + 1,
    CC_MAX = CC_MPWPASCAL + 1
    }    CALLCONV;

typedef /* [v1_enum] */
enum tagFUNCKIND
    {    FUNC_VIRTUAL = 0,
    FUNC_PUREVIRTUAL = FUNC_VIRTUAL + 1,
    FUNC_NONVIRTUAL = FUNC_PUREVIRTUAL + 1,
    FUNC_STATIC = FUNC_NONVIRTUAL + 1,
    FUNC_DISPATCH = FUNC_STATIC + 1
    }    FUNCKIND;

typedef /* [v1_enum] */
enum tagINVOKEKIND
    {    INVOKE_FUNC = 1,
    INVOKE_PROPERTYGET = 2,
    INVOKE_PROPERTYPUT = 4,
    INVOKE_PROPERTYPUTREF = 8
    }    INVOKEKIND;

typedef struct  tagFUNCDESC
    {
    MEMBERID memid;
    /* [size_is] */ ECode *lprgscode;
    /* [size_is] */ ELEMDESC *lprgelemdescParam;
    FUNCKIND funckind;
    INVOKEKIND invkind;
    CALLCONV callconv;
    Int16 cParams;
    Int16 cParamsOpt;
    Int16 oVft;
    Int16 cScodes;
    ELEMDESC elemdescFunc;
    UInt16 wFuncFlags;
    }    FUNCDESC;

typedef struct tagFUNCDESC *PFUNCDESC;

typedef /* [v1_enum] */
enum tagVARKIND
    {    VAR_PERINSTANCE = 0,
    VAR_STATIC = VAR_PERINSTANCE + 1,
    VAR_CONST = VAR_STATIC + 1,
    VAR_DISPATCH = VAR_CONST + 1
    }    VARKIND;

typedef struct  tagVARDESC
    {
    MEMBERID memid;
    wchar_t * lpstrSchema;
    /* [switch_is][switch_type] */ union
        {
        /* [case()] */ UInt32 oInst;
        /* [case()] */ VARIANT *lpvarValue;
        }    ;
    ELEMDESC elemdescVar;
    UInt16 wVarFlags;
    VARKIND varkind;
    }    VARDESC;

typedef struct tagVARDESC *PVARDESC;

#ifndef __IDispatch_INTERFACE_DEFINED__
#define __IDispatch_INTERFACE_DEFINED__

/* interface IDispatch */
/* [unique][uuid][object] */

typedef /* [unique] */ IDispatch *PDISPATCH;

EXTERN_C const IID IID_IDispatch;

#if defined(__cplusplus) && !defined(CINTERFACE)

MIDL_INTERFACE("00020400-0000-0000-C000-000000000046") IDispatch : public IUnknown
{
public:
    virtual CARAPI GetTypeInfoCount(
            /* [out] */ UInt32 *pctinfo) = 0;

    virtual CARAPI GetTypeInfo(
            /* [in] */ UInt32 iTInfo,
            /* [in] */ UInt32 lcid,
            /* [out] */ ITypeInfo **ppTInfo) = 0;

    virtual CARAPI GetIDsOfNames(
            /* [in] */ RIID riid,
            /* [size_is][in] */ wchar_t * *rgszNames,
            /* [in] */ UInt32 cNames,
            /* [in] */ UInt32 lcid,
            /* [size_is][out] */ DISPID *rgDispId) = 0;

    virtual /* [local] */ CARAPI Invoke(
            /* [in] */ DISPID dispIdMember,
            /* [in] */ RIID riid,
            /* [in] */ UInt32 lcid,
            /* [in] */ UInt16 wFlags,
            /* [out][in] */ DISPPARAMS *pDispParams,
            /* [out] */ VARIANT *pVarResult,
            /* [out] */ EXCEPINFO *pExcepInfo,
            /* [out] */ UInt32 *puArgErr) = 0;
};

#else

typedef struct IDispatchVtbl
    {

        ECode (CARAPICALLTYPE *QueryInterface )(
            IDispatch * This,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ void **ppv);

        UInt32 (CARAPICALLTYPE *AddRef )(
            IDispatch * This);

        UInt32 (CARAPICALLTYPE *Release )(
            IDispatch * This);

        ECode (CARAPICALLTYPE *GetTypeInfoCount )(
            IDispatch * This,
            /* [out] */ UInt32 *pctinfo);

        ECode (CARAPICALLTYPE *GetTypeInfo )(
            IDispatch * This,
            /* [in] */ UInt32 iTInfo,
            /* [in] */ UInt32 lcid,
            /* [out] */ ITypeInfo **ppTInfo);

        ECode (CARAPICALLTYPE *GetIDsOfNames )(
            IDispatch * This,
            /* [in] */ RIID riid,
            /* [size_is][in] */ wchar_t * *rgszNames,
            /* [in] */ UInt32 cNames,
            /* [in] */ UInt32 lcid,
            /* [size_is][out] */ DISPID *rgDispId);

        /* [local] */ ECode (CARAPICALLTYPE *Invoke )(
            IDispatch * This,
            /* [in] */ DISPID dispIdMember,
            /* [in] */ RIID riid,
            /* [in] */ UInt32 lcid,
            /* [in] */ UInt16 wFlags,
            /* [out][in] */ DISPPARAMS *pDispParams,
            /* [out] */ VARIANT *pVarResult,
            /* [out] */ EXCEPINFO *pExcepInfo,
            /* [out] */ UInt32 *puArgErr);

    } IDispatchVtbl;

interface IDispatch
    {
        CONST_VTBL struct IDispatchVtbl *v;
    };

#ifdef COBJMACROS

#define IDispatch_QueryInterface(This,riid,ppv)    \
    (This)->v -> QueryInterface(This,riid,ppv)

#define IDispatch_AddRef(This)    \
    (This)->v -> AddRef(This)

#define IDispatch_Release(This)    \
    (This)->v -> Release(This)

#define IDispatch_GetTypeInfoCount(This,pctinfo)    \
    (This)->v -> GetTypeInfoCount(This,pctinfo)

#define IDispatch_GetTypeInfo(This,iTInfo,lcid,ppTInfo)    \
    (This)->v -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)

#define IDispatch_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)    \
    (This)->v -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)

#define IDispatch_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)    \
    (This)->v -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)

#endif /* COBJMACROS */

#endif     /* C style interface */

#endif     /* __IDispatch_INTERFACE_DEFINED__ */

#ifndef __IEnumVARIANT_INTERFACE_DEFINED__
#define __IEnumVARIANT_INTERFACE_DEFINED__

/* interface IEnumVARIANT */
/* [unique][uuid][object] */

typedef /* [unique] */ IEnumVARIANT *PENUMVARIANT;

EXTERN_C const IID IID_IEnumVARIANT;

#if defined(__cplusplus) && !defined(CINTERFACE)

MIDL_INTERFACE("00020404-0000-0000-C000-000000000046") IEnumVARIANT : public IUnknown
{
public:
    virtual /* [local] */ CARAPI Next(
            /* [in] */ UInt32 celt,
            /* [length_is][size_is][out] */ VARIANT *rgVar,
            /* [out] */ UInt32 *pCeltFetched) = 0;

    virtual CARAPI Skip(
            /* [in] */ UInt32 celt) = 0;

    virtual CARAPI Reset( void) = 0;

    virtual CARAPI Clone(
            /* [out] */ IEnumVARIANT **ppEnum) = 0;
};

#else

typedef struct IEnumVARIANTVtbl
    {

        ECode (CARAPICALLTYPE *QueryInterface )(
            IEnumVARIANT * This,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ void **ppv);

        UInt32 (CARAPICALLTYPE *AddRef )(
            IEnumVARIANT * This);

        UInt32 (CARAPICALLTYPE *Release )(
            IEnumVARIANT * This);

        /* [local] */ ECode (CARAPICALLTYPE *Next )(
            IEnumVARIANT * This,
            /* [in] */ UInt32 celt,
            /* [length_is][size_is][out] */ VARIANT *rgVar,
            /* [out] */ UInt32 *pCeltFetched);

        ECode (CARAPICALLTYPE *Skip )(
            IEnumVARIANT * This,
            /* [in] */ UInt32 celt);

        ECode (CARAPICALLTYPE *Reset )(
            IEnumVARIANT * This);

        ECode (CARAPICALLTYPE *Clone )(
            IEnumVARIANT * This,
            /* [out] */ IEnumVARIANT **ppEnum);

    } IEnumVARIANTVtbl;

interface IEnumVARIANT
    {
        CONST_VTBL struct IEnumVARIANTVtbl *v;
    };

#ifdef COBJMACROS

#define IEnumVARIANT_QueryInterface(This,riid,ppv)    \
    (This)->v -> QueryInterface(This,riid,ppv)

#define IEnumVARIANT_AddRef(This)    \
    (This)->v -> AddRef(This)

#define IEnumVARIANT_Release(This)    \
    (This)->v -> Release(This)

#define IEnumVARIANT_Next(This,celt,rgVar,pCeltFetched)    \
    (This)->v -> Next(This,celt,rgVar,pCeltFetched)

#define IEnumVARIANT_Skip(This,celt)    \
    (This)->v -> Skip(This,celt)

#define IEnumVARIANT_Reset(This)    \
    (This)->v -> Reset(This)

#define IEnumVARIANT_Clone(This,ppEnum)    \
    (This)->v -> Clone(This,ppEnum)

#endif /* COBJMACROS */

#endif     /* C style interface */

#endif     /* __IEnumVARIANT_INTERFACE_DEFINED__ */

#ifndef __ITypeComp_INTERFACE_DEFINED__
#define __ITypeComp_INTERFACE_DEFINED__

/* interface ITypeComp */
/* [unique][uuid][object] */

typedef /* [unique] */ ITypeComp *PTYPECOMP;

typedef /* [v1_enum] */
enum tagDESCKIND
    {    DESCKIND_NONE = 0,
    DESCKIND_FUNCDESC = DESCKIND_NONE + 1,
    DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1,
    DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1,
    DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1,
    DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1
    }    DESCKIND;

typedef union tagBINDPTR
    {
    FUNCDESC *lpfuncdesc;
    VARDESC *lpvardesc;
    ITypeComp *lptcomp;
    }    BINDPTR;

typedef union tagBINDPTR *PBINDPTR;

EXTERN_C const IID IID_ITypeComp;

#if defined(__cplusplus) && !defined(CINTERFACE)

MIDL_INTERFACE("00020403-0000-0000-C000-000000000046") ITypeComp : public IUnknown
{
public:
    virtual /* [local] */ CARAPI Bind(
            /* [in] */ wchar_t * szName,
            /* [in] */ UInt32 lHashVal,
            /* [in] */ UInt16 wFlags,
            /* [out] */ ITypeInfo **ppTInfo,
            /* [out] */ DESCKIND *pDescKind,
            /* [out] */ BINDPTR *pBindPtr) = 0;

    virtual /* [local] */ CARAPI BindType(
            /* [in] */ wchar_t * szName,
            /* [in] */ UInt32 lHashVal,
            /* [out] */ ITypeInfo **ppTInfo,
            /* [out] */ ITypeComp **ppTComp) = 0;
};

#else

typedef struct ITypeCompVtbl
    {

        ECode (CARAPICALLTYPE *QueryInterface )(
            ITypeComp * This,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ void **ppv);

        UInt32 (CARAPICALLTYPE *AddRef )(
            ITypeComp * This);

        UInt32 (CARAPICALLTYPE *Release )(
            ITypeComp * This);

        /* [local] */ ECode (CARAPICALLTYPE *Bind )(
            ITypeComp * This,
            /* [in] */ wchar_t * szName,
            /* [in] */ UInt32 lHashVal,
            /* [in] */ UInt16 wFlags,
            /* [out] */ ITypeInfo **ppTInfo,
            /* [out] */ DESCKIND *pDescKind,
            /* [out] */ BINDPTR *pBindPtr);

        /* [local] */ ECode (CARAPICALLTYPE *BindType )(
            ITypeComp * This,
            /* [in] */ wchar_t * szName,
            /* [in] */ UInt32 lHashVal,
            /* [out] */ ITypeInfo **ppTInfo,
            /* [out] */ ITypeComp **ppTComp);

    } ITypeCompVtbl;

interface ITypeComp
    {
        CONST_VTBL struct ITypeCompVtbl *v;
    };

#ifdef COBJMACROS

#define ITypeComp_QueryInterface(This,riid,ppv)    \
    (This)->v -> QueryInterface(This,riid,ppv)

#define ITypeComp_AddRef(This)    \
    (This)->v -> AddRef(This)

#define ITypeComp_Release(This)    \
    (This)->v -> Release(This)

#define ITypeComp_Bind(This,szName,lHashVal,wFlags,ppTInfo,pDescKind,pBindPtr)    \
    (This)->v -> Bind(This,szName,lHashVal,wFlags,ppTInfo,pDescKind,pBindPtr)

#define ITypeComp_BindType(This,szName,lHashVal,ppTInfo,ppTComp)    \
    (This)->v -> BindType(This,szName,lHashVal,ppTInfo,ppTComp)

#endif /* COBJMACROS */

#endif     /* C style interface */

#endif     /* __ITypeComp_INTERFACE_DEFINED__ */

#ifndef __ITypeLib_INTERFACE_DEFINED__
#define __ITypeLib_INTERFACE_DEFINED__

/* interface ITypeLib */
/* [unique][uuid][object] */

typedef /* [unique] */ ITypeLib *PTYPELIB;

typedef /* [v1_enum] */
enum tagSYSKIND
    {    SYS_WIN16 = 0,
    SYS_WIN32 = SYS_WIN16 + 1,
    SYS_MAC = SYS_WIN32 + 1
    }    SYSKIND;

typedef struct  tagTLIBATTR
    {
    GUID guid;
    UInt32 lcid;
    SYSKIND syskind;
    UInt16 wMajorVerNum;
    UInt16 wMinorVerNum;
    UInt16 wLibFlags;
    }    TLIBATTR;

typedef struct tagTLIBATTR *PTLIBATTR;

EXTERN_C const IID IID_ITypeLib;

#if defined(__cplusplus) && !defined(CINTERFACE)

MIDL_INTERFACE("00020402-0000-0000-C000-000000000046") ITypeLib : public IUnknown
{
public:
    virtual /* [local] */ UInt32 STDMETHODCALLTYPE GetTypeInfoCount( void) = 0;

    virtual CARAPI GetTypeInfo(
            /* [in] */ UInt32 index,
            /* [out] */ ITypeInfo **ppTInfo) = 0;

    virtual CARAPI GetTypeInfoType(
            /* [in] */ UInt32 index,
            /* [out] */ TYPEKIND *pTKind) = 0;

    virtual CARAPI GetTypeInfoOfGuid(
            /* [in] */ REFGUID guid,
            /* [out] */ ITypeInfo **ppTinfo) = 0;

    virtual /* [local] */ CARAPI GetLibAttr(
            /* [out] */ TLIBATTR **ppTLibAttr) = 0;

    virtual CARAPI GetTypeComp(
            /* [out] */ ITypeComp **ppTComp) = 0;

    virtual /* [local] */ CARAPI GetDocumentation(
            /* [in] */ Int32 index,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ wchar_t* *pBstrDocString,
            /* [out] */ UInt32 *pdwHelpContext,
            /* [out] */ wchar_t* *pBstrHelpFile) = 0;

    virtual CARAPI IsName(
            /* [in] */ wchar_t * szNameBuf,
            /* [in] */ UInt32 lHashVal,
            /* [out] */ _ELASTOS Boolean *pfName) = 0;

    virtual CARAPI FindName(
            /* [in] */ wchar_t * szNameBuf,
            /* [in] */ UInt32 lHashVal,
            /* [length_is][size_is][out] */ ITypeInfo **ppTInfo,
            /* [length_is][size_is][out] */ MEMBERID *rgMemId,
            /* [out][in] */ UInt16 *pcFound) = 0;

    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseTLibAttr(
            /* [in] */ TLIBATTR *pTLibAttr) = 0;
};

#else

typedef struct ITypeLibVtbl
    {

        ECode (CARAPICALLTYPE *QueryInterface )(
            ITypeLib * This,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ void **ppv);

        UInt32 (CARAPICALLTYPE *AddRef )(
            ITypeLib * This);

        UInt32 (CARAPICALLTYPE *Release )(
            ITypeLib * This);

        /* [local] */ UInt32 ( STDMETHODCALLTYPE *GetTypeInfoCount )(
            ITypeLib * This);

        ECode (CARAPICALLTYPE *GetTypeInfo )(
            ITypeLib * This,
            /* [in] */ UInt32 index,
            /* [out] */ ITypeInfo **ppTInfo);

        ECode (CARAPICALLTYPE *GetTypeInfoType )(
            ITypeLib * This,
            /* [in] */ UInt32 index,
            /* [out] */ TYPEKIND *pTKind);

        ECode (CARAPICALLTYPE *GetTypeInfoOfGuid )(
            ITypeLib * This,
            /* [in] */ REFGUID guid,
            /* [out] */ ITypeInfo **ppTinfo);

        /* [local] */ ECode (CARAPICALLTYPE *GetLibAttr )(
            ITypeLib * This,
            /* [out] */ TLIBATTR **ppTLibAttr);

        ECode (CARAPICALLTYPE *GetTypeComp )(
            ITypeLib * This,
            /* [out] */ ITypeComp **ppTComp);

        /* [local] */ ECode (CARAPICALLTYPE *GetDocumentation )(
            ITypeLib * This,
            /* [in] */ Int32 index,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ wchar_t* *pBstrDocString,
            /* [out] */ UInt32 *pdwHelpContext,
            /* [out] */ wchar_t* *pBstrHelpFile);

        ECode (CARAPICALLTYPE *IsName )(
            ITypeLib * This,
            /* [in] */ wchar_t * szNameBuf,
            /* [in] */ UInt32 lHashVal,
            /* [out] */ _ELASTOS Boolean *pfName);

        ECode (CARAPICALLTYPE *FindName )(
            ITypeLib * This,
            /* [in] */ wchar_t * szNameBuf,
            /* [in] */ UInt32 lHashVal,
            /* [length_is][size_is][out] */ ITypeInfo **ppTInfo,
            /* [length_is][size_is][out] */ MEMBERID *rgMemId,
            /* [out][in] */ UInt16 *pcFound);

        /* [local] */ void ( STDMETHODCALLTYPE *ReleaseTLibAttr )(
            ITypeLib * This,
            /* [in] */ TLIBATTR *pTLibAttr);

    } ITypeLibVtbl;

interface ITypeLib
    {
        CONST_VTBL struct ITypeLibVtbl *v;
    };

#ifdef COBJMACROS

#define ITypeLib_QueryInterface(This,riid,ppv)    \
    (This)->v -> QueryInterface(This,riid,ppv)

#define ITypeLib_AddRef(This)    \
    (This)->v -> AddRef(This)

#define ITypeLib_Release(This)    \
    (This)->v -> Release(This)

#define ITypeLib_GetTypeInfoCount(This)    \
    (This)->v -> GetTypeInfoCount(This)

#define ITypeLib_GetTypeInfo(This,index,ppTInfo)    \
    (This)->v -> GetTypeInfo(This,index,ppTInfo)

#define ITypeLib_GetTypeInfoType(This,index,pTKind)    \
    (This)->v -> GetTypeInfoType(This,index,pTKind)

#define ITypeLib_GetTypeInfoOfGuid(This,guid,ppTinfo)    \
    (This)->v -> GetTypeInfoOfGuid(This,guid,ppTinfo)

#define ITypeLib_GetLibAttr(This,ppTLibAttr)    \
    (This)->v -> GetLibAttr(This,ppTLibAttr)

#define ITypeLib_GetTypeComp(This,ppTComp)    \
    (This)->v -> GetTypeComp(This,ppTComp)

#define ITypeLib_GetDocumentation(This,index,pBstrName,pBstrDocString,pdwHelpContext,pBstrHelpFile)    \
    (This)->v -> GetDocumentation(This,index,pBstrName,pBstrDocString,pdwHelpContext,pBstrHelpFile)

#define ITypeLib_IsName(This,szNameBuf,lHashVal,pfName)    \
    (This)->v -> IsName(This,szNameBuf,lHashVal,pfName)

#define ITypeLib_FindName(This,szNameBuf,lHashVal,ppTInfo,rgMemId,pcFound)    \
    (This)->v -> FindName(This,szNameBuf,lHashVal,ppTInfo,rgMemId,pcFound)

#define ITypeLib_ReleaseTLibAttr(This,pTLibAttr)    \
    (This)->v -> ReleaseTLibAttr(This,pTLibAttr)

#endif /* COBJMACROS */

#endif     /* C style interface */

#endif     /* __ITypeLib_INTERFACE_DEFINED__ */

#ifndef __ITypeInfo_INTERFACE_DEFINED__
#define __ITypeInfo_INTERFACE_DEFINED__

/* interface ITypeInfo */
/* [unique][uuid][object] */

typedef /* [unique] */ ITypeInfo *PTYPEINFO;

EXTERN_C const IID IID_ITypeInfo;

#if defined(__cplusplus) && !defined(CINTERFACE)

MIDL_INTERFACE("00020401-0000-0000-C000-000000000046") ITypeInfo : public IUnknown
{
public:
    virtual /* [local] */ CARAPI GetTypeAttr(
            /* [out] */ TYPEATTR **ppTypeAttr) = 0;

    virtual CARAPI GetTypeComp(
            /* [out] */ ITypeComp **ppTComp) = 0;

    virtual /* [local] */ CARAPI GetFuncDesc(
            /* [in] */ UInt32 index,
            /* [out] */ FUNCDESC **ppFuncDesc) = 0;

    virtual /* [local] */ CARAPI GetVarDesc(
            /* [in] */ UInt32 index,
            /* [out] */ VARDESC **ppVarDesc) = 0;

    virtual CARAPI GetNames(
            /* [in] */ MEMBERID memid,
            /* [length_is][size_is][out] */ wchar_t* *rgBstrNames,
            /* [in] */ UInt32 cMaxNames,
            /* [out] */ UInt32 *pcNames) = 0;

    virtual CARAPI GetRefTypeOfImplType(
            /* [in] */ UInt32 index,
            /* [out] */ HREFTYPE *pRefType) = 0;

    virtual CARAPI GetImplTypeFlags(
            /* [in] */ UInt32 index,
            /* [out] */ Int32 *pImplTypeFlags) = 0;

    virtual CARAPI GetIDsOfNames(
            /* [size_is][in] */ wchar_t * *rgszNames,
            /* [in] */ UInt32 cNames,
            /* [size_is][out] */ MEMBERID *pMemId) = 0;

    virtual /* [local] */ CARAPI Invoke(
            /* [in] */ PVoid pvInstance,
            /* [in] */ MEMBERID memid,
            /* [in] */ UInt16 wFlags,
            /* [out][in] */ DISPPARAMS *pDispParams,
            /* [out] */ VARIANT *pVarResult,
            /* [out] */ EXCEPINFO *pExcepInfo,
            /* [out] */ UInt32 *puArgErr) = 0;

    virtual /* [local] */ CARAPI GetDocumentation(
            /* [in] */ MEMBERID memid,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ wchar_t* *pBstrDocString,
            /* [out] */ UInt32 *pdwHelpContext,
            /* [out] */ wchar_t* *pBstrHelpFile) = 0;

    virtual /* [local] */ CARAPI GetDllEntry(
            /* [in] */ MEMBERID memid,
            /* [in] */ INVOKEKIND invKind,
            /* [out] */ wchar_t* *pBstrDllName,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ UInt16 *pwOrdinal) = 0;

    virtual CARAPI GetRefTypeInfo(
            /* [in] */ HREFTYPE hRefType,
            /* [out] */ ITypeInfo **ppTInfo) = 0;

    virtual /* [local] */ CARAPI AddressOfMember(
            /* [in] */ MEMBERID memid,
            /* [in] */ INVOKEKIND invKind,
            /* [out] */ PVoid *ppv) = 0;

    virtual /* [local] */ CARAPI CreateObject(
            /* [in] */ IUnknown *pUnkOuter,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ PVoid *ppvObj) = 0;

    virtual CARAPI GetMops(
            /* [in] */ MEMBERID memid,
            /* [out] */ wchar_t* *pBstrMops) = 0;

    virtual CARAPI GetContainingTypeLib(
            /* [out] */ ITypeLib **ppTLib,
            /* [out] */ UInt32 *pIndex) = 0;

    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseTypeAttr(
            /* [in] */ TYPEATTR *pTypeAttr) = 0;

    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseFuncDesc(
            /* [in] */ FUNCDESC *pFuncDesc) = 0;

    virtual /* [local] */ void STDMETHODCALLTYPE ReleaseVarDesc(
            /* [in] */ VARDESC *pVarDesc) = 0;
};

#else

typedef struct ITypeInfoVtbl
    {

        ECode (CARAPICALLTYPE *QueryInterface )(
            ITypeInfo * This,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ void **ppv);

        UInt32 (CARAPICALLTYPE *AddRef )(
            ITypeInfo * This);

        UInt32 (CARAPICALLTYPE *Release )(
            ITypeInfo * This);

        /* [local] */ ECode (CARAPICALLTYPE *GetTypeAttr )(
            ITypeInfo * This,
            /* [out] */ TYPEATTR **ppTypeAttr);

        ECode (CARAPICALLTYPE *GetTypeComp )(
            ITypeInfo * This,
            /* [out] */ ITypeComp **ppTComp);

        /* [local] */ ECode (CARAPICALLTYPE *GetFuncDesc )(
            ITypeInfo * This,
            /* [in] */ UInt32 index,
            /* [out] */ FUNCDESC **ppFuncDesc);

        /* [local] */ ECode (CARAPICALLTYPE *GetVarDesc )(
            ITypeInfo * This,
            /* [in] */ UInt32 index,
            /* [out] */ VARDESC **ppVarDesc);

        ECode (CARAPICALLTYPE *GetNames )(
            ITypeInfo * This,
            /* [in] */ MEMBERID memid,
            /* [length_is][size_is][out] */ wchar_t* *rgBstrNames,
            /* [in] */ UInt32 cMaxNames,
            /* [out] */ UInt32 *pcNames);

        ECode (CARAPICALLTYPE *GetRefTypeOfImplType )(
            ITypeInfo * This,
            /* [in] */ UInt32 index,
            /* [out] */ HREFTYPE *pRefType);

        ECode (CARAPICALLTYPE *GetImplTypeFlags )(
            ITypeInfo * This,
            /* [in] */ UInt32 index,
            /* [out] */ Int32 *pImplTypeFlags);

        ECode (CARAPICALLTYPE *GetIDsOfNames )(
            ITypeInfo * This,
            /* [size_is][in] */ wchar_t * *rgszNames,
            /* [in] */ UInt32 cNames,
            /* [size_is][out] */ MEMBERID *pMemId);

        /* [local] */ ECode (CARAPICALLTYPE *Invoke )(
            ITypeInfo * This,
            /* [in] */ PVoid pvInstance,
            /* [in] */ MEMBERID memid,
            /* [in] */ UInt16 wFlags,
            /* [out][in] */ DISPPARAMS *pDispParams,
            /* [out] */ VARIANT *pVarResult,
            /* [out] */ EXCEPINFO *pExcepInfo,
            /* [out] */ UInt32 *puArgErr);

        /* [local] */ ECode (CARAPICALLTYPE *GetDocumentation )(
            ITypeInfo * This,
            /* [in] */ MEMBERID memid,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ wchar_t* *pBstrDocString,
            /* [out] */ UInt32 *pdwHelpContext,
            /* [out] */ wchar_t* *pBstrHelpFile);

        /* [local] */ ECode (CARAPICALLTYPE *GetDllEntry )(
            ITypeInfo * This,
            /* [in] */ MEMBERID memid,
            /* [in] */ INVOKEKIND invKind,
            /* [out] */ wchar_t* *pBstrDllName,
            /* [out] */ wchar_t* *pBstrName,
            /* [out] */ UInt16 *pwOrdinal);

        ECode (CARAPICALLTYPE *GetRefTypeInfo )(
            ITypeInfo * This,
            /* [in] */ HREFTYPE hRefType,
            /* [out] */ ITypeInfo **ppTInfo);

        /* [local] */ ECode (CARAPICALLTYPE *AddressOfMember )(
            ITypeInfo * This,
            /* [in] */ MEMBERID memid,
            /* [in] */ INVOKEKIND invKind,
            /* [out] */ PVoid *ppv);

        /* [local] */ ECode (CARAPICALLTYPE *CreateObject )(
            ITypeInfo * This,
            /* [in] */ IUnknown *pUnkOuter,
            /* [in] */ RIID riid,
            /* [iid_is][out] */ PVoid *ppvObj);

        ECode (CARAPICALLTYPE *GetMops )(
            ITypeInfo * This,
            /* [in] */ MEMBERID memid,
            /* [out] */ wchar_t* *pBstrMops);

        ECode (CARAPICALLTYPE *GetContainingTypeLib )(
            ITypeInfo * This,
            /* [out] */ ITypeLib **ppTLib,
            /* [out] */ UInt32 *pIndex);

        /* [local] */ void ( STDMETHODCALLTYPE *ReleaseTypeAttr )(
            ITypeInfo * This,
            /* [in] */ TYPEATTR *pTypeAttr);

        /* [local] */ void ( STDMETHODCALLTYPE *ReleaseFuncDesc )(
            ITypeInfo * This,
            /* [in] */ FUNCDESC *pFuncDesc);

        /* [local] */ void ( STDMETHODCALLTYPE *ReleaseVarDesc )(
            ITypeInfo * This,
            /* [in] */ VARDESC *pVarDesc);

    } ITypeInfoVtbl;

interface ITypeInfo
    {
        CONST_VTBL struct ITypeInfoVtbl *v;
    };

#ifdef COBJMACROS

#define ITypeInfo_QueryInterface(This,riid,ppv)    \
    (This)->v -> QueryInterface(This,riid,ppv)

#define ITypeInfo_AddRef(This)    \
    (This)->v -> AddRef(This)

#define ITypeInfo_Release(This)    \
    (This)->v -> Release(This)

#define ITypeInfo_GetTypeAttr(This,ppTypeAttr)    \
    (This)->v -> GetTypeAttr(This,ppTypeAttr)

#define ITypeInfo_GetTypeComp(This,ppTComp)    \
    (This)->v -> GetTypeComp(This,ppTComp)

#define ITypeInfo_GetFuncDesc(This,index,ppFuncDesc)    \
    (This)->v -> GetFuncDesc(This,index,ppFuncDesc)

#define ITypeInfo_GetVarDesc(This,index,ppVarDesc)    \
    (This)->v -> GetVarDesc(This,index,ppVarDesc)

#define ITypeInfo_GetNames(This,memid,rgBstrNames,cMaxNames,pcNames)    \
    (This)->v -> GetNames(This,memid,rgBstrNames,cMaxNames,pcNames)

#define ITypeInfo_GetRefTypeOfImplType(This,index,pRefType)    \
    (This)->v -> GetRefTypeOfImplType(This,index,pRefType)

#define ITypeInfo_GetImplTypeFlags(This,index,pImplTypeFlags)    \
    (This)->v -> GetImplTypeFlags(This,index,pImplTypeFlags)

#define ITypeInfo_GetIDsOfNames(This,rgszNames,cNames,pMemId)    \
    (This)->v -> GetIDsOfNames(This,rgszNames,cNames,pMemId)

#define ITypeInfo_Invoke(This,pvInstance,memid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)    \
    (This)->v -> Invoke(This,pvInstance,memid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)

#define ITypeInfo_GetDocumentation(This,memid,pBstrName,pBstrDocString,pdwHelpContext,pBstrHelpFile)    \
    (This)->v -> GetDocumentation(This,memid,pBstrName,pBstrDocString,pdwHelpContext,pBstrHelpFile)

#define ITypeInfo_GetDllEntry(This,memid,invKind,pBstrDllName,pBstrName,pwOrdinal)    \
    (This)->v -> GetDllEntry(This,memid,invKind,pBstrDllName,pBstrName,pwOrdinal)

#define ITypeInfo_GetRefTypeInfo(This,hRefType,ppTInfo)    \
    (This)->v -> GetRefTypeInfo(This,hRefType,ppTInfo)

#define ITypeInfo_AddressOfMember(This,memid,invKind,ppv)    \
    (This)->v -> AddressOfMember(This,memid,invKind,ppv)

#define ITypeInfo_CreateObject(This,pUnkOuter,riid,ppvObj)    \
    (This)->v -> CreateObject(This,pUnkOuter,riid,ppvObj)

#define ITypeInfo_GetMops(This,memid,pBstrMops)    \
    (This)->v -> GetMops(This,memid,pBstrMops)

#define ITypeInfo_GetContainingTypeLib(This,ppTLib,pIndex)    \
    (This)->v -> GetContainingTypeLib(This,ppTLib,pIndex)

#define ITypeInfo_ReleaseTypeAttr(This,pTypeAttr)    \
    (This)->v -> ReleaseTypeAttr(This,pTypeAttr)

#define ITypeInfo_ReleaseFuncDesc(This,pFuncDesc)    \
    (This)->v -> ReleaseFuncDesc(This,pFuncDesc)

#define ITypeInfo_ReleaseVarDesc(This,pVarDesc)    \
    (This)->v -> ReleaseVarDesc(This,pVarDesc)

#endif /* COBJMACROS */

#endif     /* C style interface */

#endif     /* __ITypeInfo_INTERFACE_DEFINED__ */

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif
